import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import Movie from "../views/Movie";
import Theater from "../views/Theater";
import MyCenter from "../views/myCenter";
import Hot from "../views/Hot";
import ComingSoon from "../views/ComingSoon"

Vue.use(VueRouter);

const routes = [
  {
    path:"/",
    redirect:'/home'
  },
  //首页
  {
    path: "/home",
    name: "home",
    redirect:'/home/movie',
    component: Home,
    children:[
      {
        path:'movie',
        component:Movie,
        redirect:"/home/movie/hot",
        children:[
          {
            path:'hot',
            component:Hot
          },
          {
            path:'comingsoon',
            component:ComingSoon
          }
        ]
        
      },
      {
        path:'theater',
        component:Theater
      },
      {
        path:'myCenter',
        component:MyCenter
      },
    ]
  },

];

const router = new VueRouter({
  routes
});

export default router;
